From: Florian Müllner Date: Wed, 20 Jan 2021 00:44:21 +0000 (+0100) Subject: appDisplay: Do not duplicate app favorites X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~576 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8c792969bb381d7176a59ee75a1dabe42483823b;p=gnome-shell.git appDisplay: Do not duplicate app favorites With the new position, the dash is now stronger connected to the app grid than it used to; reflect that by showing apps either in the grid or the dash, not both (except for non-favorite running apps). https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/88 Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index a2c6adaa0..a80fb773b 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -218,6 +218,11 @@ var BaseAppView = GObject.registerClass({ this._redisplay(); }); + // Don't duplicate favorites + this._appFavorites = AppFavorites.getAppFavorites(); + this._appFavoritesChangedId = + this._appFavorites.connect('changed', () => this._redisplay()); + // Drag n' Drop this._lastOvershoot = -1; this._lastOvershootTimeoutId = 0; @@ -236,6 +241,11 @@ var BaseAppView = GObject.registerClass({ this._appFilterChangedId = 0; } + if (this._appFavoritesChangedId > 0) { + this._appFavorites.disconnect(this._appFavoritesChangedId); + this._appFavoritesChangedId = 0; + } + if (this._swipeTracker) { this._swipeTracker.destroy(); delete this._swipeTracker; @@ -1138,7 +1148,8 @@ class AppDisplay extends BaseAppView { } catch (e) { return false; } - return this._parentalControlsManager.shouldShowApp(appInfo); + return !this._appFavorites.isFavorite(appInfo.get_id()) && + this._parentalControlsManager.shouldShowApp(appInfo); }); let apps = this._appInfoList.map(app => app.get_id()); @@ -1757,6 +1768,9 @@ class FolderView extends BaseAppView { if (excludedApps.includes(appId)) return; + if (this._appFavorites.isFavorite(appId)) + return; + const app = appSys.lookup_app(appId); if (!app) return;